//
//  YTFaceLiveness3D.hpp
//  FaceLiveness3D
//
//  Created by PanCheng on 15/11/2017.
//  Copyright © 2017 PanCheng. All rights reserved.
//

#ifndef YTFaceLiveness3D_hpp
#define YTFaceLiveness3D_hpp

#include <opencv2/core/core.hpp>
#include <vector>
#include <string>
#include "YTTrackCommonDefine.h"

using namespace yt_backend_facetrackpro;

namespace yt_3d_face_liveness_sdk{
    class yt_3d_face_liveness_runner;
}

namespace yt_face_liveness3d
{
  /***************************************
  *image: BGR
  *depth: 1channel, 16bit,  scale-10
  *depthRange: 90 (90mm)
  *faceShape:  facial points
  ****************************************/
  struct FaceLive3DInput {
      FaceLive3DInput(){}
      cv::Mat image;
      cv::Mat depth;
      int depthRange;
      TC_FaceShape faceShape;
  };

  /***************************************
  *score_img: 0-1
  *score_depth: 0-1
  *faceDist: the distance (mm) between face and camera 
  ****************************************/
  struct FaceLive3DOutput{
      FaceLive3DOutput(){}
      float score_img;
      float score_depth;
      int faceDist;
  };



  class YTFaceLiveness3D
  {
  public:
      YTFaceLiveness3D();
      ~YTFaceLiveness3D();
      
      static int GlobalInit(const char *modelDir);
      static int GlobalRelease();
      static std::string Version();
      
      int doFaceLivenessScore(const FaceLive3DInput &livenessInput, FaceLive3DOutput &livenessRes);
      
  private:
      yt_3d_face_liveness_sdk::yt_3d_face_liveness_runner * m_runner;
  };
}
#endif /* YTFaceLiveness3D_hpp */
